#include "tcpServer.hpp"

#include <memory>
#include <cstdio>

using namespace server;

static void Usage(void* proc){
    std::cerr << "\nUsage:\n\t" << proc << "serverip serverport\n\n";
}

// ./tcpServer serverport
int main(int argc, char* argv[]){
    if(argc != 2){
        Usage(argv[0]);
        exit(USAGE_ERROR);
    }
    uint16_t serverport = atoi(argv[1]);

    std::unique_ptr<tcpServer> tser(new tcpServer(serverport));
    tser->initServer();
    tser->start();

    return 0;
}